import 'package:kkhousekeep/generated/json/base/json_convert_content.dart';
import 'package:kkhousekeep/models/home_banner_entity.dart';

HomeBannerEntity $HomeBannerEntityFromJson(Map<String, dynamic> json) {
	final HomeBannerEntity homeBannerEntity = HomeBannerEntity();
	final int? code = jsonConvert.convert<int>(json['code']);
	if (code != null) {
		homeBannerEntity.code = code;
	}
	final HomeBannerObj? obj = jsonConvert.convert<HomeBannerObj>(json['obj']);
	if (obj != null) {
		homeBannerEntity.obj = obj;
	}
	final String? msg = jsonConvert.convert<String>(json['msg']);
	if (msg != null) {
		homeBannerEntity.msg = msg;
	}
	return homeBannerEntity;
}

Map<String, dynamic> $HomeBannerEntityToJson(HomeBannerEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['code'] = entity.code;
	data['obj'] = entity.obj.toJson();
	data['msg'] = entity.msg;
	return data;
}

HomeBannerObj $HomeBannerObjFromJson(Map<String, dynamic> json) {
	final HomeBannerObj homeBannerObj = HomeBannerObj();
	final List<HomeBannerObjList>? list = jsonConvert.convertListNotNull<HomeBannerObjList>(json['list']);
	if (list != null) {
		homeBannerObj.list = list;
	}
	final int? total = jsonConvert.convert<int>(json['total']);
	if (total != null) {
		homeBannerObj.total = total;
	}
	return homeBannerObj;
}

Map<String, dynamic> $HomeBannerObjToJson(HomeBannerObj entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['list'] =  entity.list.map((v) => v.toJson()).toList();
	data['total'] = entity.total;
	return data;
}

HomeBannerObjList $HomeBannerObjListFromJson(Map<String, dynamic> json) {
	final HomeBannerObjList homeBannerObjList = HomeBannerObjList();
	final int? id = jsonConvert.convert<int>(json['id']);
	if (id != null) {
		homeBannerObjList.id = id;
	}
	final String? title = jsonConvert.convert<String>(json['title']);
	if (title != null) {
		homeBannerObjList.title = title;
	}
	final String? imageUrl = jsonConvert.convert<String>(json['imageUrl']);
	if (imageUrl != null) {
		homeBannerObjList.imageUrl = imageUrl;
	}
	final int? sort = jsonConvert.convert<int>(json['sort']);
	if (sort != null) {
		homeBannerObjList.sort = sort;
	}
	final String? publishTime = jsonConvert.convert<String>(json['publishTime']);
	if (publishTime != null) {
		homeBannerObjList.publishTime = publishTime;
	}
	final String? createTime = jsonConvert.convert<String>(json['createTime']);
	if (createTime != null) {
		homeBannerObjList.createTime = createTime;
	}
	final String? updateTime = jsonConvert.convert<String>(json['updateTime']);
	if (updateTime != null) {
		homeBannerObjList.updateTime = updateTime;
	}
	final int? cid = jsonConvert.convert<int>(json['cid']);
	if (cid != null) {
		homeBannerObjList.cid = cid;
	}
	return homeBannerObjList;
}

Map<String, dynamic> $HomeBannerObjListToJson(HomeBannerObjList entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['title'] = entity.title;
	data['imageUrl'] = entity.imageUrl;
	data['sort'] = entity.sort;
	data['publishTime'] = entity.publishTime;
	data['createTime'] = entity.createTime;
	data['updateTime'] = entity.updateTime;
	data['cid'] = entity.cid;
	return data;
}